<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id='root'></div>
   

    <script src="../demo1/js/react.development.js"></script>
     <script src="../demo1/js/react-dom.development.js"></script>
     <script src="../demo1/js/babel.min.js"></script>
     <script src="./js/prop-types.js"></script> 

     <script type="text/babel">
    // API 
    // 1  useState
    // 2  useEffect
    // 3  useReducer


        function Hook1(){

            const [name, setName] = React.useState('lihua')

            return (
                <div>
                    <h1>{name}</h1>    
                    <button onClick={()=>setName('张ansa')}>zzzz</button>
                </div>
            )
        }

        ReactDOM.render(<Hook1/>, document.getElementById('root'))
        
    </script>
</body>
</html>